﻿@using System.Globalization
@model NodaTime.Web.Models.MethodHistoryModel

@{ViewBag.Title = "History of " + Model.Method + " in " + Model.Machine;}

<h2>@ViewBag.Title</h2>

@if (Model.AllResults)
{
    <p>(Viewing full history; @Html.ActionLink("list of significant changes", "MethodHistory", new { machine = Model.Machine, method = Model.Method }) also available.)</p>
}
else
{
    <p>(Viewing list of significant changes; @Html.ActionLink("full history", "MethodHistory", new { machine = Model.Machine, method = Model.Method, full = true}) also available.)</p>
}

<table class="table">
    <tr>
        <th>Date/time</th>
        <th>Label</th>
        <th>Result</th>
    </tr>

    @foreach (var item in Model.Entries)
    {
        <tr>
            <td>@item.Run.StartTime.ToString("yyyy-MM-dd HH:mm'Z'", CultureInfo.InvariantCulture)</td>
            <td>@Html.ActionLink(item.Run.Label, "BenchmarkRun", new { machine = item.Run.Machine, label = item.Run.Label })
            <td>@item.Description</td>
        </tr>
    }
</table>